package com.solution.admin.sysconfig.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solution.admin.sysconfig.dao.WechatMsgKeywordReplyDao;
import com.solution.admin.sysconfig.entity.WechatMsgKeywordReplyEntity;
import com.solution.admin.sysconfig.service.WechatMsgKeywordReplyService;
import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.common.utils.string.StringUtil;

/**
 * 微信消息关键字回复service实现层
 * @author solin
 * @date 2017-11-30 14:50:18
 */
@Service
public class WechatMsgKeywordReplyServiceImpl extends BaseServiceImpl<WechatMsgKeywordReplyEntity> implements WechatMsgKeywordReplyService {

	/**
	 * 微信消息关键字回复接口
	 */
	@Autowired
	private WechatMsgKeywordReplyDao wechatMsgKeywordReplyDao;

	protected BaseDao<WechatMsgKeywordReplyEntity> getDao() {
		return this.wechatMsgKeywordReplyDao;
	}

	/**
	 * 保存微信消息关键字回复
	 * @param wechatMsgKeywordReplyEntity 微信消息关键字回复实体
	 * @return Long 添加成功微信消息关键字回复的ID
	 * @author solin
	 * @date 2017-11-30 14:50:18
	 */
	public long saveWechatMsgKeywordReply(WechatMsgKeywordReplyEntity wechatMsgKeywordReplyEntity) {
		return wechatMsgKeywordReplyDao.saveWechatMsgKeywordReply(wechatMsgKeywordReplyEntity);
	}

	/**
	 * 分页查询微信消息关键字回复
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author solin
	 * @date 2017-11-30 14:50:18
	 */
	@Override
	public PageBean listWechatMsgKeywordReplyPage(PageParam pageParam, Map<String, Object> paramMap) {
		return wechatMsgKeywordReplyDao.listWechatMsgKeywordReplyPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return wechatMsgKeywordReplyEntity 用户对象
	 * @author solin
	 * @date 2017-11-30 14:50:18
	 */
	public WechatMsgKeywordReplyEntity getWechatMsgKeywordReplyById(Long id) {
		return wechatMsgKeywordReplyDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param wechatMsgKeywordReplyEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author solin
	 * @date 2017-11-30 14:50:18
	 */
	@Override
	public int updateWechatMsgKeywordReply(WechatMsgKeywordReplyEntity wechatMsgKeywordReplyEntity) {
		return wechatMsgKeywordReplyDao.updateWechatMsgKeywordReply(wechatMsgKeywordReplyEntity);
	}
	
	
	/**
	 * 根据条件查询微信消息关键字回复
	 * @param param
	 * @return 数据列表
	 * @author solin
	 * @date 2017-11-30 14:50:18
	 */
	@Override
	public List<WechatMsgKeywordReplyEntity> listWechatMsgKeywordReply( Map<String, Object> param){
		return  wechatMsgKeywordReplyDao.listWechatMsgKeywordReply(param);
	}
	
	/**
	 * 删除微信消息关键字回复
	 * @param 
	 * @return int 返回删除记录条数
	 * @author solin
	 * @date 2017-11-30 14:50:18
	 */
	public int deleteWechatMsgKeywordReplyById(long id){
		return  wechatMsgKeywordReplyDao.deleteById(id);
	}

	/**
	 * 根据关键字获取对象
	 * @param keyWord
	 * @return
	 * @author xkl
	 * @date 2018年3月6日 下午7:54:54
	 */
	@Override
	public WechatMsgKeywordReplyEntity getByKeyWord(String keyWord) {
		return wechatMsgKeywordReplyDao.getByKeyWord(keyWord);
	}
	
}
